﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MINERP.MODEL.FoundationModel;
using MINERP.LeaderOperate.Controller;

namespace MINERP.LeaderOperate
{
    public partial class FrmSelectBackTch : Form
    {
        public int OrderInfoId { get; set; }//产品名称ID
        public Dictionary<int, string> Techs { get; set; }//本组能操作的结点列表
        public int BackTechId { get { return  (int)rgTechs.EditValue; } }//要返工的结点ID
        public string OrderProductRemark { get { return txtRemark.Text.Trim(); } }//备注

        private FrmBackPresenter _presenter;


        public FrmSelectBackTch()
        {
            InitializeComponent();
        }

        internal void IniliateView(OrderInfo_Info oi)
        {
            lblCtmName.Text = oi.CtmName;
            lblProductCode.Text = oi.OrderProductCode;
            lblProductName.Text = oi.OrderProductName;
            txtRemark.Text = oi.Remark;

            foreach (var tch in Techs)
            {
                rgTechs.Properties.Items.Add(new DevExpress.XtraEditors.Controls.RadioGroupItem(tch.Key, tch.Value));
            }
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            _presenter.BackOrder();
        }

        private void FrmSelectBackTch_Load(object sender, EventArgs e)
        {
            _presenter = new FrmBackPresenter(this);
        }
    }
}
